#include<stdio.h>

void sort(int low,int high,int a[]){
	int i=low,j=high;
	int temp=a[low];
	if(low<high){
		while(i<j){
			while(temp<=a[j]&&i<j){
				j--;
			}
			if(i<j)
				a[i]=a[j];
			while(temp>=a[i]&&i<j){
				i++;
			}
			if(i<j)
				a[j]=a[i];
		}
		a[i]=temp;
		sort(low,i-1,a);
		sort(i+1,high,a);
	}
}
int main(void){
	int low=0,high=4;
	int a[5]={8,5,4,2,3};
	sort(low,high,a);
	for(int i=0;i<5;i++){
		printf("%d\t",a[i]);	
	}
}
